//
//  JSUITool.h
//  JSKit
//
//  Created by Apple on 2019/7/22.
//  Copyright © 2019 Apple. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN


@interface JSUITool : NSObject


@property (nonatomic, assign, readonly) double screenWidth;
@property (nonatomic, assign, readonly) double screenHeight;
/**
 * 项目中主文字大小 默认 15
 */
@property (nonatomic, assign) CGFloat bodyFontSize;
@property (nonatomic, assign) CGFloat mediumFontSize;  /// 默认 12
@property (nonatomic, assign) CGFloat lowerFontSize; // 默认 10

@property (nonatomic, assign) NSInteger bodyBlack;  // 默认 0x1b1a20
@property (nonatomic, assign) NSInteger mediumBlack;  // 默认 0x333333
@property (nonatomic, assign) NSInteger lowerBlack;  // 默认 0x666666

@property (nonatomic, assign) NSInteger bodyGray;  // 默认 0x666666
@property (nonatomic, assign) NSInteger mediumGray;  // 默认 0x999999
@property (nonatomic, assign) NSInteger lowerGray;  // 默认 0xaaaaaa

@property (nonatomic, assign) NSInteger appBgColor; // app 背景色
@property (nonatomic, assign) NSInteger appBodyColor; // app 主题色
@property (nonatomic, assign) BOOL neeFitFont;  // 是否需要适配字体 默认不适配

/// 界面适配 默认以6s屏幕为基础进行计算 不过不需要进行计算 设为 nil
@property (nonatomic, copy) CGFloat(^fit)(CGFloat oriValue);

+ (instancetype)sharedInstance;


@end

@interface UILabel (JSUITool)

@property (nonatomic, copy, readonly) UILabel*(^js_text)(NSString *text);
@property (nonatomic, copy, readonly) UILabel*(^js_textColor)(UIColor *color);
@property (nonatomic, copy, readonly) UILabel*(^js_textFont)(UIFont *font);
@property (nonatomic, copy, readonly) UILabel*(^js_textAlignment)(NSTextAlignment alignment);
@property (nonatomic, copy, readonly) UILabel*(^js_attributedString)(NSAttributedString *attributedString);
@property (nonatomic, copy, readonly) UILabel*(^js_lineBreakMode)(NSLineBreakMode lineBreakMode);
@property (nonatomic, copy, readonly) UILabel*(^js_baselineAdjustment)(UIBaselineAdjustment baselineAdjustment);
@property (nonatomic, copy, readonly) UILabel*(^js_lableNumbOfLines)(NSInteger numberOfLines);
@property (nonatomic, copy, readonly) UILabel*(^js_highlightedTextColor)(UIColor *color);
@property (nonatomic, copy, readonly) UILabel*(^js_debugText)(NSString *test);

@property (nonatomic, copy, readonly) UILabel*(^js_createLabel)(NSString *text, UIFont *font, UIColor *color, NSString *debugText);
@property (nonatomic, copy, readonly) UILabel*(^js_createBreakLabel)(NSString *text, UIFont *font, UIColor *color, NSLineBreakMode breakMode, NSInteger numberOfLines, NSString *debugText);

@end

@interface YYLabel (JSUITool)

@property (nonatomic, copy, readonly) YYLabel*(^js_text)(NSString *text);
@property (nonatomic, copy, readonly) YYLabel*(^js_textColor)(UIColor *color);
@property (nonatomic, copy, readonly) YYLabel*(^js_textFont)(UIFont *font);
@property (nonatomic, copy, readonly) YYLabel*(^js_textAlignment)(NSTextAlignment alignment);
@property (nonatomic, copy, readonly) YYLabel*(^js_attributedString)(NSAttributedString *attributedString);
@property (nonatomic, copy, readonly) YYLabel*(^js_lineBreakMode)(NSLineBreakMode lineBreakMode);
@property (nonatomic, copy, readonly) YYLabel*(^js_lableNumbOfLines)(NSInteger numberOfLines);
@property (nonatomic, copy, readonly) YYLabel*(^js_debugText)(NSString *test);

@property (nonatomic, copy, readonly) YYLabel*(^js_createLabel)(NSString *text, UIFont *font, UIColor *color, NSString *debugText);

@end

@interface UIView (JSUITool)

@property (nonatomic, copy, readonly) UIView*(^js_bgColor)(UIColor *color);
@property (nonatomic, copy, readonly) UIView*(^js_shadow)(CGSize offset, CGFloat opacity, CGFloat radius, UIColor *color);
@property (nonatomic, copy, readonly) UIView*(^js_tintAdjustmentMode)(UIViewTintAdjustmentMode model);
@property (nonatomic, copy, readonly) UIView*(^js_cornerRadiusShadow)(CGFloat cornerRadius, CGSize offset, CGFloat opacity, CGFloat radius);
@property (nonatomic, copy, readonly) UIView*(^js_border)(UIColor *borderColor, CGFloat borderWidth, CGFloat radius);
@property (nonatomic, copy, readonly) UIView*(^js_radius)(CGFloat radius);
@property (nonatomic, copy, readonly) UIView*(^js_maskToBouns)(BOOL clip);
@property (nonatomic, copy, readonly) UIView*(^js_userEnabled)(BOOL enabled);
@property (nonatomic, copy, readonly) UIView*(^js_hidden)(BOOL hidden);
@property (nonatomic, copy, readonly) UIView*(^js_alpha)(CGFloat alpha);
@property (nonatomic, copy, readonly) UIView*(^js_contentMode)(UIViewContentMode mode);
@property (nonatomic, copy, readonly) UIView*(^js_frame)(CGRect frame);
@property (nonatomic, copy, readonly) UIView*(^js_center)(CGPoint center);
@property (nonatomic, copy, readonly) UIView*(^js_size)(CGSize size);
@property (nonatomic, copy, readonly) UIView*(^js_left)(CGFloat left);
@property (nonatomic, copy, readonly) UIView*(^js_top)(CGFloat top);
@property (nonatomic, copy, readonly) UIView*(^js_width)(CGFloat width);
@property (nonatomic, copy, readonly) UIView*(^js_height)(CGFloat height);
@property (nonatomic, copy, readonly) UIView*(^js_right)(CGFloat right);
@property (nonatomic, copy, readonly) UIView*(^js_bottom)(CGFloat bottom);
@property (nonatomic, copy, readonly) UIView*(^js_addSubViews)(NSArray *views);


@end

@interface UIButton (JSUITool)

@property (nonatomic, copy, readonly) UIButton*(^js_image)(UIImage *image, UIControlState state);
@property (nonatomic, copy, readonly) UIButton*(^js_title)(NSString *title, UIControlState state);
@property (nonatomic, copy, readonly) UIButton*(^js_textColor)(UIColor *color, UIControlState state);
@property (nonatomic, copy, readonly) UIButton*(^js_normalTitle)(NSString *title);
@property (nonatomic, copy, readonly) UIButton*(^js_textNormalColor)(UIColor *color);
@property (nonatomic, copy, readonly) UIButton*(^js_normalImage)(UIImage *image);
@property (nonatomic, copy, readonly) UIButton*(^js_textFont)(UIFont *font);
@property (nonatomic, copy, readonly) UIButton*(^js_debugText)(NSString *test);


@end

NS_ASSUME_NONNULL_END
